package com.zs.toolbox.web2j.system.core.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.zs.toolbox.web2j.common.domain.WtBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 权限表
 * </p>
 *
 * @author eric.zhang
 * @since 2018-09-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_permission")
@ApiModel(value="WtPermissionEntity对象", description="权限表")
public class WtPermissionEntity extends WtBaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "每两个字符代表一级，可N级")
    @TableField("permission_code")
    private String permissionCode;

    @ApiModelProperty(value = "本权限的解释")
    @TableField("permission_name")
    private String permissionName;

    @ApiModelProperty(value = "是否为API路径权限 api,menu,etc...")
    @TableField("permission_type")
    private String permissionType;

    @ApiModelProperty(value = "匹配模式串，如是API，就是相关的路径 如是菜单则是菜单的名称前缀，也可用与自定义其它需求")
    @TableField("permission_pattern")
    private String permissionPattern;

@TableField(value = "create_user", fill = FieldFill.INSERT)
    private Integer createUser = 0;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField("delete_status")
    @TableLogic
    private Integer deleteStatus = 1;

    @TableField(value = "update_time", update = "now()", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


}
